find_library(BULLET_COLLISION_LIBRARY NAMES BulletCollision PATHS ${MYGE_EXTERNAL_LIBRARY_PATH} NO_CMAKE_FIND_ROOT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
find_library(BULLET_DYNAMICS_LIBRARY NAMES BulletDynamics PATHS ${MYGE_EXTERNAL_LIBRARY_PATH} NO_CMAKE_FIND_ROOT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
find_library(BULLET_LINEARMATH_LIBRARY NAMES LinearMath PATHS ${MYGE_EXTERNAL_LIBRARY_PATH} NO_CMAKE_FIND_ROOT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
IF(ORBIS)
    find_library(SCE_POSIX_LIBRARY NAMES ScePosix_stub_weak PATHS "$ENV{SCE_ORBIS_SDK_DIR}/target/lib")
ENDIF(ORBIS)

add_library(BulletPhysics BulletPhysicsManager.cpp)
target_include_directories(BulletPhysics PUBLIC GeomMath)
target_link_libraries(BulletPhysics GeomMath ${BULLET_DYNAMICS_LIBRARY} ${BULLET_COLLISION_LIBRARY} ${BULLET_LINEARMATH_LIBRARY})
IF(ORBIS)
    target_link_libraries(BulletPhysics ${SCE_POSIX_LIBRARY})
ENDIF(ORBIS)
